﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MachineVision.Common;
using MachineVision.Core;
using MachineVision.Models;
using MachineVision.Services;
using MachineVision.TemplateMatch.Views;
using Prism.Commands;
using Prism.Regions;

namespace MachineVision.ViewModels
{
    public class DashboardViewModel : NavigationViewModel
    {
        public DashboardViewModel(INavigationService navigation, IRegionManager regionManager)
        {
            Navigation = navigation;
            RegionManager = regionManager;
        }


        private DelegateCommand<NavigationItem> _onMenuClick;
        public DelegateCommand<NavigationItem> OnMenuClick =>
            _onMenuClick ?? (_onMenuClick = new DelegateCommand<NavigationItem>(ExecuteOnMenuClick));

        void ExecuteOnMenuClick(NavigationItem parameter)
        {
            RegionManager.RequestNavigate(Regions.MainViewRegion, parameter.PageName);
        }




        public INavigationService Navigation { get; }
        public IRegionManager RegionManager { get; }
    }
}
